package com.cmsz.upay;

import com.cmsz.upay.service.HiveServiceImpl;
import com.cmsz.upay.service.IHiveService;
import org.junit.Test;

import java.io.BufferedReader;
import java.io.File;
import java.io.FileReader;
import java.io.InputStreamReader;

/**
 * Created by le on 2017/12/18.
 */
public class test {

    @Test
    public void testParsingXml(){
        InputStreamReader read = new InputStreamReader(this.getClass().getResourceAsStream("/OCDB1-P20171218-05.dmp")) ;
        IHiveService hiveService=new HiveServiceImpl();
        try{
            BufferedReader br = new BufferedReader(read);//构造一个BufferedReader类来读取文件
            String s = null;
            while((s = br.readLine())!=null){//使用readLine方法，一次读一行
                hiveService.parsingXML(s);
            }
            br.close();
        }catch(Exception e){
            e.printStackTrace();
        }

    }

}
